Repository navigation
Keep matrix-valued X, Y and Z for single-node and single-block models - #76
Draft
alexpghayes wants to merge 1 commit into
Draft
alexpghayes wants to merge 1 commit into
alexpghayes wants to merge 1 commit into
Conversation
- Matrix(1, nrow = 1, ncol = 1) returns a unit diagonal ddiMatrix, whose `x` slot can't be set, so dcsbm(theta = 1, B = matrix(1)) and other one-node, one-block models crashed. Build the k = 1 membership matrix with doDiag = FALSE. - sort_by_all_columns() and mmsbm()'s sorting subset rows without drop = FALSE, so sbm(n = 1, B = diag(2)) crashed and overlapping_sbm() with k = 1 stored Z as a plain numeric vector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bugs
dcsbm(theta = 1, B = matrix(1))crashed:Matrix(1, 1, 1)returns a unit-diagonalddiMatrix, and setting its@xfails. The same applied to every one-node, one-block model (chung_lu(theta = 1),erdos_renyi(n = 1),directed_dcsbm()withn = 1andk = 1).sbm(n = 1, B = diag(2))crashed:X[idx, ]insort_by_all_columns()(R/utils.R) dropped to a vector.overlapping_sbm()withk = 1andsort_nodes = TRUEstoredZ(andX) as a plain numeric vector, for the same reason.mmsbm()'s sorting had the same[idx, ]pattern.Fix
k = 1membership matrices withMatrix(1, nrow = n, ncol = 1, doDiag = FALSE)(dcsbm(),directed_dcsbm(), both Erdős–Rényi constructors). Forn > 1this is the samedgeMatrixas before.drop = FALSEinsort_by_all_columns()and inmmsbm()'s sorting.Tests
New
tests/testthat/test-single-node.R. Fails onmain(2 failures, 2 errors), passes here. Full suite passes. Noman/changes.Merges cleanly with #63, #66, #68, #70 and #71, which touch nearby lines.
NEWS
Left out to avoid conflicting with #59. Suggested bullet under Bug fixes:
🤖 Generated with Claude Code